﻿@model EnetaMvc.Web.Models.ForumViewModel
@{
	Layout = "~/Views/Shared/_ForumsLayout.cshtml";
}
@section TopRssLinks {
	<ul class="small-menu rss-menu">
	<li><a href="@Url.Content("~/forums/forum/" + Model.Forum.Id + "/rss")">RSS: @Model.Forum.Name</a></li>
    @if (User.IsInRole("Administrator"))
    { 
        <li><a href="@Url.Action("EditForum", new { id = Model.Forum.Id })">@Resources.EnetaMvc.EditForum</a></li>
        <li><a href="@Url.Action("DeleteForum", new { id = Model.Forum.Id })">@Resources.EnetaMvc.DeleteForum</a></li>
    }
	</ul>
}
@section BottomRssLinks {
	<ul class="small-menu rss-menu">
	<li><a href="@Url.Content("~/forums/forum/" + Model.Forum.Id + "/rss")">RSS: @Model.Forum.Name</a></li>
	</ul>
}
<p class="ms-navheader"> 
	<a href='@Url.Content("~/forums/category/" + Model.Forum.CategoryId)'>@Model.Forum.CategoryName</a> » 
	<a href='@Url.Content("~/forums/forum/" + Model.Forum.Id)'>@Model.Forum.Name</a>
</p>

<table width="100%" cellspacing="0" cellpadding="3" class="forums-tools"><!-- Lembit 29.06.2009: added class="forums-tools" --> 
	<tr> 
		<td align="left">&nbsp;</td> 
		<td align="right"> 
		<!-- Lembit 8.11.2009: added wrapper div w/ class="button" to links below --> 			
			<div class="button"><a href="@Url.Content("~/forums/newtopic/" + Model.Forum.Id + "/")">@Resources.EnetaMvc.NewTopic</a></div> 
		</td> 
	</tr> 
</table>


<table width="100%" cellspacing=0 cellpadding=3>
<tr>
<td colspan="6" class="ms-ToolPaneTitle"><span>@Model.Forum.Name</span></td>
</tr>
<tr>
	<td width="1%" class="ms-TPHeader">&nbsp;</td>
	<td align="left" class="ms-TPHeader"><strong>@Resources.EnetaMvc.Topic</strong></td>
	<td align="center" width="7%" class="ms-TPHeader"><strong>@Resources.EnetaMvc.Replies</strong></td>
	<td align="center" width="7%" class="ms-TPHeader"><strong>@Resources.EnetaMvc.Author</strong></td>
	<td align="center" width="7%" class="ms-TPHeader"><strong>@Resources.EnetaMvc.Views</strong></td>
	<td align="center" width="22%" class="ms-TPHeader"><strong>@Resources.EnetaMvc.LastPost</strong></td>
</tr>
@foreach (var post in Model.Posts.Results)
{ 
	<tr class="ms-alternating">
		<td><img src="@Url.Content("~/images/COMACT.GIF")"></td>
		<td><a href="@Url.Content("~/forums/topic/" + post.Id)">@post.Title</a></td>
		<td>@post.NumberOfReplies</td>
		<td><a href="@Url.Content("~/profiles/details/" + post.CreatedById)">@post.CreatedByUserName</a></td>
		<td>@post.Views</td>
		<td>
			@post.LastPost.Created.ToString("dd.MMM.yyyy, hh:mm")<br />
			<a href="@Url.Content("~/profiles/details/" + post.LastPost.CreatedById)">@post.LastPost.CreatedByUserName</a>
		</td>
	</tr>
}
</table>
<table width="100%" cellspacing="0" cellpadding="3" class="forums-tools" style="display:block; float:none; width:628px;"><!-- Lembit 29.06.2009: added class="forums-tools" --> 		
	<tr> 
		<td align="left" style="width:314px;float:left; text-align:left;">
			@Html.GetPager(Model.Posts, Url.Content("~/forums/forum/" + Model.Forum.Id + "/"))		
		</td> 
		<td align="right" style="width:314px;float:right;"> 
			<div class="button" style="float:right">
				<a href="@Url.Content("~/forums/newtopic/" + Model.Forum.Id + "/")">@Resources.EnetaMvc.NewTopic</a>
			</div> 
		</td> 
	</tr> 
</table>